package roborally.model;

import be.kuleuven.cs.som.annotate.*;
import be.kuleuven.cs.som.taglet.*;

/**
 * A Class of walls. Walls cannot share their position with other elements.
 * 
 * @author Mathieu REYMOND
 * @author Joren VERSPEURT
 * 
 * @version 2.0
 *
 */
public class Wall extends Element {

	/**
	 * Create a new wall with no board and no position.
	 * 
	 * @effect ...
	 * 		   | this(null, null)
	 */
	public Wall() {
		this(null, null);
	}
	
	/**
	 * Create a wall with a given board and position.
	 * 
	 * @param board The given board
	 * @param position The given position
	 * 
	 * @effect ...
	 * 		   new.setBoardPosition(board, position)
	 */
	public Wall(Board board, Position position) {
		super();
		setBoardPosition(board, position);
	}
	
	/**
	 * Check if a wall can share a position with another element.
	 * 
	 * @param other The other element to check.
	 * 
	 * @return ...
	 * 		   | result == false
	 */
	@Override
	public boolean canSharePositionWith(Element other) {
		
		return false;
	}

	/**
	 * Getting shot by lasers has no effect on walls.
	 * 
	 * @post new.equals(this)
	 */
	@Raw @Override
	public void takeShot() {}

	/**
	 * Clone this wall.
	 * 
	 * @effect ...
	 * 		   | this(getBoard(), getPosition())
	 */
	@Override
	public Element clone() {
		return new Wall(getBoard(), getPosition());
	}
	
	/**
	 * Gives a String that describes this wall.
	 * 
	 * @return ...
	 * 		   | "W(" + getPosition().getX() + ", " + getPosition().getY() + ")"
	 */
	@Override
	public String toString() {
		return "W(" + getPosition().getX() + ", " + getPosition().getY() + ")";
	}

}
